Fixing sychronization and concurrency issues#123
Conversation
…String sql, String[] selectionArgs) New method getLocalModifiedNotes() is a preparation for bugfixing #117
… fix several bugs belonging concurrency and synchronization. Outstanding: documentation, testing, cosmetic changes
…String sql, String[] selectionArgs) New method getLocalModifiedNotes() is a preparation for bugfixing #117
… fix several bugs belonging concurrency and synchronization. Outstanding: documentation, testing, cosmetic changes
…nc-bugfix-refactoring
…nterface using callbacks, only try to sync if not offline, otherwise show an error message.
|
I think i have some free time at this weekend. I'll test this, merge this and if all is going well, i'll build a new version for F-Droid. |
… changed in edit (before, callback was never invoked in this case)
…ndSync is still running. In addition, start next saveAndSync not before a small delay has passed.
|
looks good. shall i wait for the three open tasks or do prefer to merge now? |
|
I tested my branch again and I found an embarrassing bug. Unfortunately, I can't fix before Monday. So please wait a few days. I'll write a comment here when I'm finished. |
|
ready to merge :-) |
|
\o/ wooohoo! Thanks a lot for the support!! |
|
@korelstar just let me say a huge thank you again - i just had time again to watch your code and it looks awesome. |
|
I will have a look at this issue and fix it as soon as possible, but I can't tell when, since I just changed my residence and I haven't access to my working station yet. |

This is the current state of my attempt to fix #117. It's not fully finished yet, but the majority of the work is done. Therefore, please have a look at this pull request and test it with all the test cases you can imagine. I will update the pull request continually.
Finished Tasks
REMOTE_ID(fixes conflicts between parallel creation of different notes locally and remotely)LOCAL_CREATEDis not used anymore (distinction if Note is new or edited can be made with checkingREMOTE_ID=0; fixes conflicts on synchronization and parallel local edits)DBNote(representing the local DB entry of a note) andOwnCloudNote(representing the remote note, used byNotesClient).updateNoteAndSync(): only make database changes, if the content really changed (fixes don't autosave if the note isn't modified #104, at least the original intention of the author).Other Issues I've Found (not covered by this pull request)
ItemAdaptershould use aCursorAdapterwhich is updated automatically if the backend data is changed.pullRemoteChanges()could use theexcludeparameter of the Notes API in a first step to check which notes changed without downloading unchanged notes. Only in the second step, the whole note content would be downloaded from the changed note. This could save traffic, however, it has to be investigated if the effort worth it (what is the typical/topmost number and size of notes?).